package com.springboot.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.demo.entity.Book;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SearchBookMapper extends BaseMapper<Book> {

//    @Select("Select * From book where bname like #{bookname}")
    @Select("Select * From book where bname like concat('%', #{bookname}, '%')")
    List<Book> getBook(String bookname);

    @Select("SELECT * FROM book where bname=#{bookname} and author=#{bookauthor}")
    List<Book> getBook1(String bookname,String bookauthor);

    @Select("Select * From book")
    List<Book> getAllBook();

    @Select("Select * From book where ID=#{id}")
    Book getBookByID(long id);
}